home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / remdatab / frmrdbde.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-08-12  |  18.5 KB  |  531 lines

  1. VERSION 5.00
  2. Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
  3. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  4. Object = "{59986FC1-1A8F-11D3-8054-00105A154E54}#1.1#0"; "DARDB.OCX"
  5. Begin VB.Form frmRDBDemo 
  6.    BorderStyle     =   3  'Fixed Dialog
  7.    Caption         =   "Business Components RemoteDataBar Demo"
  8.    ClientHeight    =   6492
  9.    ClientLeft      =   36
  10.    ClientTop       =   324
  11.    ClientWidth     =   6132
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   6492
  16.    ScaleWidth      =   6132
  17.    StartUpPosition =   2  'CenterScreen
  18.    Begin VB.TextBox txtUserID 
  19.       Appearance      =   0  'Flat
  20.       DataField       =   "UserID"
  21.       DataSource      =   "DARemDataBar1"
  22.       Height          =   285
  23.       Left            =   5280
  24.       Locked          =   -1  'True
  25.       TabIndex        =   4
  26.       Top             =   600
  27.       Width           =   732
  28.    End
  29.    Begin VB.PictureBox picForm 
  30.       Appearance      =   0  'Flat
  31.       BorderStyle     =   0  'None
  32.       ForeColor       =   &H80000008&
  33.       Height          =   2412
  34.       Left            =   120
  35.       ScaleHeight     =   2412
  36.       ScaleWidth      =   6012
  37.       TabIndex        =   18
  38.       TabStop         =   0   'False
  39.       Top             =   960
  40.       Width           =   6015
  41.       Begin VB.TextBox txtLastName 
  42.          Appearance      =   0  'Flat
  43.          DataField       =   "LastName"
  44.          DataSource      =   "DARemDataBar1"
  45.          Height          =   288
  46.          Left            =   840
  47.          MaxLength       =   50
  48.          TabIndex        =   6
  49.          Top             =   0
  50.          Width           =   2052
  51.       End
  52.       Begin VB.TextBox Text1 
  53.          Appearance      =   0  'Flat
  54.          DataField       =   "FirstName"
  55.          DataSource      =   "DARemDataBar1"
  56.          Height          =   288
  57.          Left            =   3840
  58.          MaxLength       =   50
  59.          TabIndex        =   8
  60.          Top             =   0
  61.          Width           =   2052
  62.       End
  63.       Begin TabDlg.SSTab sstMain 
  64.          Height          =   1812
  65.          Left            =   0
  66.          TabIndex        =   9
  67.          Top             =   480
  68.          Width           =   5892
  69.          _ExtentX        =   10393
  70.          _ExtentY        =   3196
  71.          _Version        =   393216
  72.          Tabs            =   2
  73.          TabsPerRow      =   2
  74.          TabHeight       =   520
  75.          TabCaption(0)   =   "Contact Info"
  76.          TabPicture(0)   =   "frmRDBDemo.frx":0000
  77.          Tab(0).ControlEnabled=   -1  'True
  78.          Tab(0).Control(0)=   "Label1"
  79.          Tab(0).Control(0).Enabled=   0   'False
  80.          Tab(0).Control(1)=   "Label3"
  81.          Tab(0).Control(1).Enabled=   0   'False
  82.          Tab(0).Control(2)=   "txtPhone"
  83.          Tab(0).Control(2).Enabled=   0   'False
  84.          Tab(0).Control(3)=   "txtEmail"
  85.          Tab(0).Control(3).Enabled=   0   'False
  86.          Tab(0).ControlCount=   4
  87.          TabCaption(1)   =   "Comments"
  88.          TabPicture(1)   =   "frmRDBDemo.frx":001C
  89.          Tab(1).ControlEnabled=   0   'False
  90.          Tab(1).Control(0)=   "txtComments"
  91.          Tab(1).ControlCount=   1
  92.          Begin VB.TextBox txtEmail 
  93.             Appearance      =   0  'Flat
  94.             DataField       =   "Email"
  95.             DataSource      =   "DARemDataBar1"
  96.             Height          =   288
  97.             Left            =   1080
  98.             MaxLength       =   50
  99.             TabIndex        =   13
  100.             Top             =   1080
  101.             Width           =   3492
  102.          End
  103.          Begin VB.TextBox txtPhone 
  104.             Appearance      =   0  'Flat
  105.             DataField       =   "Company"
  106.             DataSource      =   "DARemDataBar1"
  107.             Height          =   288
  108.             Left            =   1080
  109.             MaxLength       =   50
  110.             TabIndex        =   11
  111.             Top             =   600
  112.             Width           =   3492
  113.          End
  114.          Begin VB.TextBox txtComments 
  115.             Appearance      =   0  'Flat
  116.             DataField       =   "Comments"
  117.             DataSource      =   "DARemDataBar1"
  118.             Height          =   1212
  119.             Left            =   -74880
  120.             MaxLength       =   1000
  121.             MultiLine       =   -1  'True
  122.             ScrollBars      =   2  'Vertical
  123.             TabIndex        =   14
  124.             Top             =   480
  125.             Width           =   5652
  126.          End
  127.          Begin VB.Label Label3 
  128.             AutoSize        =   -1  'True
  129.             Caption         =   "E-mail"
  130.             Height          =   192
  131.             Left            =   240
  132.             TabIndex        =   12
  133.             Top             =   1080
  134.             Width           =   456
  135.          End
  136.          Begin VB.Label Label1 
  137.             AutoSize        =   -1  'True
  138.             Caption         =   "Company"
  139.             Height          =   192
  140.             Left            =   240
  141.             TabIndex        =   10
  142.             Top             =   600
  143.             Width           =   696
  144.          End
  145.          Begin VB.Label Label6 
  146.             Caption         =   "Amount Owed"
  147.             Height          =   255
  148.             Left            =   -74760
  149.             TabIndex        =   19
  150.             Top             =   600
  151.             Width           =   1215
  152.          End
  153.       End
  154.       Begin VB.Label lblField 
  155.          AutoSize        =   -1  'True
  156.          BackStyle       =   0  'Transparent
  157.          Caption         =   "Last Name"
  158.          Height          =   192
  159.          Index           =   0
  160.          Left            =   0
  161.          TabIndex        =   5
  162.          Top             =   0
  163.          Width           =   780
  164.       End
  165.       Begin VB.Label lblField 
  166.          AutoSize        =   -1  'True
  167.          BackStyle       =   0  'Transparent
  168.          Caption         =   "First Name"
  169.          Height          =   192
  170.          Index           =   1
  171.          Left            =   3000
  172.          TabIndex        =   7
  173.          Top             =   0
  174.          Width           =   780
  175.       End
  176.    End
  177.    Begin VB.CommandButton cmdUpdate 
  178.       Caption         =   "&Update"
  179.       Height          =   375
  180.       Left            =   2760
  181.       TabIndex        =   1
  182.       Top             =   0
  183.       Width           =   855
  184.    End
  185.    Begin DARDB.DARemDataBar DARemDataBar1 
  186.       Align           =   1  'Align Top
  187.       Height          =   372
  188.       Left            =   0
  189.       TabIndex        =   0
  190.       Top             =   0
  191.       Width           =   6132
  192.       _ExtentX        =   10816
  193.       _ExtentY        =   656
  194.       Server          =   ""
  195.       Connect         =   "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=Users.mdb"
  196.       RecordSource    =   "SELECT * FROM Users"
  197.       Enabled         =   -1  'True
  198.       UpdateType      =   0
  199.       FetchMetaData   =   -1  'True
  200.    End
  201.    Begin MSDataGridLib.DataGrid DataGrid1 
  202.       Bindings        =   "frmRDBDemo.frx":0038
  203.       Height          =   1692
  204.       Left            =   120
  205.       TabIndex        =   15
  206.       Top             =   3480
  207.       Width           =   5892
  208.       _ExtentX        =   10393
  209.       _ExtentY        =   2985
  210.       _Version        =   393216
  211.       HeadLines       =   1
  212.       RowHeight       =   16
  213.       FormatLocked    =   -1  'True
  214.       BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  215.          Name            =   "MS Sans Serif"
  216.          Size            =   7.8
  217.          Charset         =   0
  218.          Weight          =   400
  219.          Underline       =   0   'False
  220.          Italic          =   0   'False
  221.          Strikethrough   =   0   'False
  222.       EndProperty
  223.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  224.          Name            =   "MS Sans Serif"
  225.          Size            =   7.8
  226.          Charset         =   0
  227.          Weight          =   400
  228.          Underline       =   0   'False
  229.          Italic          =   0   'False
  230.          Strikethrough   =   0   'False
  231.       EndProperty
  232.       ColumnCount     =   6
  233.       BeginProperty Column00 
  234.          DataField       =   "UserID"
  235.          Caption         =   "UserID"
  236.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  237.             Type            =   0
  238.             Format          =   ""
  239.             HaveTrueFalseNull=   0
  240.             FirstDayOfWeek  =   0
  241.             FirstWeekOfYear =   0
  242.             LCID            =   1033
  243.             SubFormatType   =   0
  244.          EndProperty
  245.       EndProperty
  246.       BeginProperty Column01 
  247.          DataField       =   "FirstName"
  248.          Caption         =   "FirstName"
  249.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  250.             Type            =   0
  251.             Format          =   ""
  252.             HaveTrueFalseNull=   0
  253.             FirstDayOfWeek  =   0
  254.             FirstWeekOfYear =   0
  255.             LCID            =   1033
  256.             SubFormatType   =   0
  257.          EndProperty
  258.       EndProperty
  259.       BeginProperty Column02 
  260.          DataField       =   "LastName"
  261.          Caption         =   "LastName"
  262.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  263.             Type            =   0
  264.             Format          =   ""
  265.             HaveTrueFalseNull=   0
  266.             FirstDayOfWeek  =   0
  267.             FirstWeekOfYear =   0
  268.             LCID            =   1033
  269.             SubFormatType   =   0
  270.          EndProperty
  271.       EndProperty
  272.       BeginProperty Column03 
  273.          DataField       =   "Company"
  274.          Caption         =   "Company"
  275.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  276.             Type            =   0
  277.             Format          =   ""
  278.             HaveTrueFalseNull=   0
  279.             FirstDayOfWeek  =   0
  280.             FirstWeekOfYear =   0
  281.             LCID            =   1033
  282.             SubFormatType   =   0
  283.          EndProperty
  284.       EndProperty
  285.       BeginProperty Column04 
  286.          DataField       =   "Email"
  287.          Caption         =   "Email"
  288.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  289.             Type            =   0
  290.             Format          =   ""
  291.             HaveTrueFalseNull=   0
  292.             FirstDayOfWeek  =   0
  293.             FirstWeekOfYear =   0
  294.             LCID            =   1033
  295.             SubFormatType   =   0
  296.          EndProperty
  297.       EndProperty
  298.       BeginProperty Column05 
  299.          DataField       =   "Comments"
  300.          Caption         =   "Comments"
  301.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  302.             Type            =   0
  303.             Format          =   ""
  304.             HaveTrueFalseNull=   0
  305.             FirstDayOfWeek  =   0
  306.             FirstWeekOfYear =   0
  307.             LCID            =   1033
  308.             SubFormatType   =   0
  309.          EndProperty
  310.       EndProperty
  311.       SplitCount      =   1
  312.       BeginProperty Split0 
  313.          BeginProperty Column00 
  314.             ColumnWidth     =   780.095
  315.          EndProperty
  316.          BeginProperty Column01 
  317.             ColumnWidth     =   1944
  318.          EndProperty
  319.          BeginProperty Column02 
  320.             ColumnWidth     =   1944
  321.          EndProperty
  322.          BeginProperty Column03 
  323.             ColumnWidth     =   1944
  324.          EndProperty
  325.          BeginProperty Column04 
  326.             ColumnWidth     =   1944
  327.          EndProperty
  328.          BeginProperty Column05 
  329.             ColumnWidth     =   1944
  330.          EndProperty
  331.       EndProperty
  332.    End
  333.    Begin MSDataGridLib.DataGrid DataGrid2 
  334.       Height          =   852
  335.       Left            =   120
  336.       TabIndex        =   17
  337.       Top             =   5520
  338.       Width           =   5892
  339.       _ExtentX        =   10393
  340.       _ExtentY        =   1503
  341.       _Version        =   393216
  342.       HeadLines       =   1
  343.       RowHeight       =   16
  344.       FormatLocked    =   -1  'True
  345.       BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  346.          Name            =   "MS Sans Serif"
  347.          Size            =   7.8
  348.          Charset         =   0
  349.          Weight          =   400
  350.          Underline       =   0   'False
  351.          Italic          =   0   'False
  352.          Strikethrough   =   0   'False
  353.       EndProperty
  354.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  355.          Name            =   "MS Sans Serif"
  356.          Size            =   7.8
  357.          Charset         =   0
  358.          Weight          =   400
  359.          Underline       =   0   'False
  360.          Italic          =   0   'False
  361.          Strikethrough   =   0   'False
  362.       EndProperty
  363.       ColumnCount     =   6
  364.       BeginProperty Column00 
  365.          DataField       =   "UserID"
  366.          Caption         =   "UserID"
  367.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  368.             Type            =   0
  369.             Format          =   ""
  370.             HaveTrueFalseNull=   0
  371.             FirstDayOfWeek  =   0
  372.             FirstWeekOfYear =   0
  373.             LCID            =   1033
  374.             SubFormatType   =   0
  375.          EndProperty
  376.       EndProperty
  377.       BeginProperty Column01 
  378.          DataField       =   "FirstName"
  379.          Caption         =   "FirstName"
  380.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  381.             Type            =   0
  382.             Format          =   ""
  383.             HaveTrueFalseNull=   0
  384.             FirstDayOfWeek  =   0
  385.             FirstWeekOfYear =   0
  386.             LCID            =   1033
  387.             SubFormatType   =   0
  388.          EndProperty
  389.       EndProperty
  390.       BeginProperty Column02 
  391.          DataField       =   "LastName"
  392.          Caption         =   "LastName"
  393.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  394.             Type            =   0
  395.             Format          =   ""
  396.             HaveTrueFalseNull=   0
  397.             FirstDayOfWeek  =   0
  398.             FirstWeekOfYear =   0
  399.             LCID            =   1033
  400.             SubFormatType   =   0
  401.          EndProperty
  402.       EndProperty
  403.       BeginProperty Column03 
  404.          DataField       =   "Company"
  405.          Caption         =   "Company"
  406.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  407.             Type            =   0
  408.             Format          =   ""
  409.             HaveTrueFalseNull=   0
  410.             FirstDayOfWeek  =   0
  411.             FirstWeekOfYear =   0
  412.             LCID            =   1033
  413.             SubFormatType   =   0
  414.          EndProperty
  415.       EndProperty
  416.       BeginProperty Column04 
  417.          DataField       =   "Email"
  418.          Caption         =   "Email"
  419.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  420.             Type            =   0
  421.             Format          =   ""
  422.             HaveTrueFalseNull=   0
  423.             FirstDayOfWeek  =   0
  424.             FirstWeekOfYear =   0
  425.             LCID            =   1033
  426.             SubFormatType   =   0
  427.          EndProperty
  428.       EndProperty
  429.       BeginProperty Column05 
  430.          DataField       =   "Comments"
  431.          Caption         =   "Comments"
  432.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  433.             Type            =   0
  434.             Format          =   ""
  435.             HaveTrueFalseNull=   0
  436.             FirstDayOfWeek  =   0
  437.             FirstWeekOfYear =   0
  438.             LCID            =   1033
  439.             SubFormatType   =   0
  440.          EndProperty
  441.       EndProperty
  442.       SplitCount      =   1
  443.       BeginProperty Split0 
  444.          BeginProperty Column00 
  445.             ColumnWidth     =   780.095
  446.          EndProperty
  447.          BeginProperty Column01 
  448.             ColumnWidth     =   1944
  449.          EndProperty
  450.          BeginProperty Column02 
  451.             ColumnWidth     =   1944
  452.          EndProperty
  453.          BeginProperty Column03 
  454.             ColumnWidth     =   1944
  455.          EndProperty
  456.          BeginProperty Column04 
  457.             ColumnWidth     =   1944
  458.          EndProperty
  459.          BeginProperty Column05 
  460.             ColumnWidth     =   1944
  461.          EndProperty
  462.       EndProperty
  463.    End
  464.    Begin VB.Label Label2 
  465.       AutoSize        =   -1  'True
  466.       Caption         =   "Conflicting records"
  467.       ForeColor       =   &H8000000D&
  468.       Height          =   192
  469.       Left            =   120
  470.       TabIndex        =   16
  471.       Top             =   5280
  472.       Width           =   1320
  473.    End
  474.    Begin VB.Label lblTitle 
  475.       AutoSize        =   -1  'True
  476.       BackStyle       =   0  'Transparent
  477.       Caption         =   "User Setup"
  478.       BeginProperty Font 
  479.          Name            =   "Arial"
  480.          Size            =   14.4
  481.          Charset         =   0
  482.          Weight          =   400
  483.          Underline       =   0   'False
  484.          Italic          =   0   'False
  485.          Strikethrough   =   0   'False
  486.       EndProperty
  487.       Height          =   324
  488.       Left            =   120
  489.       TabIndex        =   2
  490.       Top             =   480
  491.       Width           =   1452
  492.    End
  493.    Begin VB.Label lblField 
  494.       Alignment       =   1  'Right Justify
  495.       AutoSize        =   -1  'True
  496.       BackStyle       =   0  'Transparent
  497.       Caption         =   "User ID"
  498.       Height          =   192
  499.       Index           =   2
  500.       Left            =   4560
  501.       TabIndex        =   3
  502.       Top             =   600
  503.       Width           =   660
  504.    End
  505. Attribute VB_Name = "frmRDBDemo"
  506. Attribute VB_GlobalNameSpace = False
  507. Attribute VB_Creatable = False
  508. Attribute VB_PredeclaredId = True
  509. Attribute VB_Exposed = False
  510. Option Explicit
  511. Private Sub cmdUpdate_Click()
  512.     Me.MousePointer = vbHourglass
  513.     DARemDataBar1.UpdateBatchConf
  514.     If DARemDataBar1.ConflictRecordset Is Nothing Then
  515.         ' If there were no conflicts, call UpdateBatch so that _
  516.           changed records do not get re-submitted (UpdateBatch causes _
  517.           UnderlyingValue to be set to Value for all records).
  518.         DARemDataBar1.Recordset.UpdateBatch
  519.         Set DataGrid2.DataSource = Nothing
  520.         DataGrid2.Refresh
  521.     Else
  522.         Set DataGrid2.DataSource = DARemDataBar1.ConflictRecordset
  523.     End If
  524.     ' Call RefreshData to fill in UserID values for new records.
  525.     DARemDataBar1.RefreshData
  526.     Me.MousePointer = vbDefault
  527. End Sub
  528. Private Sub DARemDataBar1_BeforeDelete(rs As ADODB.Recordset, ByVal db As DADAO.Database, adStatus As ADODB.EventStatusEnum)
  529.     If MsgBox("Delete?", vbOKCancel) = vbCancel Then adStatus = adStatusCancel
  530. End Sub
  531.